package com.xnyzc.lhy.common.penum;

import com.xnyzc.lhy.common.entity.PEnum;

/**
 * 滴滴错误码枚举
 *
 * @Author: wangshuo
 * @Date: 2019/10/08 17:47
 */
public enum EDiDiErrorCode implements PEnum<Integer> {
    //成功标志
    success(0, "success"),
    //参数及数据错误
    failureOfVerification(10001, "验签失败"),
    userTookenVerification(10002, "用户token错误"),

    httpRequestDidiUrlError(1, "Http请求滴滴服务失败"),
    driverStatusError(190, "司机已删除或被拉黑"),
    serverError(10100, "服务器错误"),
    networkTimeout(101, "网络超时"),
    signError(102, "签名错误"),
    parameterError(103, "参数错误"),
    configError(104, "获取配置错误"),
    requestDate(105, "请求过期"),
    haveEntertained(106, "订单已被其他平台受理"),
    missingAuthArgs(201, "请求头缺少权限参数"),
    orderFlow(107, "订单流转非法"),
    unData(111, "未获取到数据"),
    dataException(188,"数据异常,请联系客服处理!"),

    grabSingleError(13001, "抢单失败"),
    singleCanceledError(13002, "抢单失败-订单已取消"),
    singleGrabbedError(13003, "抢单失败-订单已被抢"),
    singleTimeoutError(13004, "抢单失败-播单超时"),
    doubleOrderError(13004, "抢单失败-您已存在1小时内的订单"),
    grabSingleSuccess(13010, "抢单成功-被自己抢"),
    orderNotCompleted(113, "订单未完成"),

    orderPaid(114, "订单已支付"),
    orderEndError(115, "订单完单失败"),
    orderCreateFail(116, "订单创建失败"),
    gatewayDeny(206, "请求失败，请稍后再试!"),
    // 逻辑验证，参数错误
    mileageObtainFail(400, "里程获取失败"),
    travelTimeObtainFail(401, "行驶时间获取失败"),
    mileageFeeIsNull(402, "里程费获取失败"),
    unKnow(403, "未知错误"),
    getListOfValuationIsNull(404, "获取估价列表为空"),
    orderPersonalUpdateFail(405, "修改订单失败"),
    driverOrderCreateFail(406, "创建司机接单表失败"),
    orderPersonalInsertFail(407, "订单数据库插入失败"),
    orderPersonalSelectFail(408, "订单查询失败"),
    getStriveCallbackFail(409, "滴滴抢单接口调用失败"),
    driverSingleSynchronousFail(409, "滴滴司机抢单结果同步失败"),
    mySqlOperationFail(410, "数据库操作失败"),
    didiSheetMqFail(411, "司机抢单结果回调保护机制失效"),
    gaoDeServiceFail(412, "高德服务调用失败"),
    updateOrderInfoFail(413, "修改订单信息失败"),
    notOrderStatus(414, "没有此订单状态"),
    cancelOrderFail(415, "取消订单失败"),
    grabSheetAddMsgFail(416, "订单表添加司机信息失败"),
    noHaveSpecialSheet(417, "没有此计价规则"),
    syncDriverLocationFail(418, "修改订单信息失败"),
    customerEvaluateFail(419, "用户评价司机失败"),
    jsonConvertError(420, "JSON转换异常"),
    dOrderUpdateFail(421, "修改司机订单失败"),
    dOrderSelectFail(422, "查询司机订单失败"),
    dUserInfoSelectFail(423, "查询司机详细信息失败"),
    driverNotOnline(424, "司机非在线状态，操作失败，请稍后再试"),
    driverOrderOnlyOne(425, "司机同时间只能接一个订单"),
    didiRequestPaymentNoticeNotInfo(426, "滴滴调用支付通知接口时，回调支付详情查询无支付信息"),
    // 客服
    closeOrderParamsError(500, "客服关单订单状态非法"),
    cancelOrderStatusError(510, "当前状态不允许取消订单!"),
    closeOrderStatusError(511, "当前状态不允许关闭订单!"),
    closeOrderDiDiStatusError(514, "当前滴滴方状态不允许关闭订单!"),
    freeSheetError(512, "客服免单失败"),
    priceRevisionError(513, "客服改价失败"),
    // 合力服务错误
    httpRequestHeLiError(501, "http访问合力失败"),
    // 跨服务错误
    screeningDriversFeignFail(413, "跨服务调用筛选司机失败"),
    grabSingLeFeignError(600, "跨服务调用司机抢单失败"),
    orderDetailFeignError(601, "跨服务调用查询订单详情失败"),
    orderStatusFeignError(602, "跨服务调用查询订单状态失败"),
    // 滴滴返回抢单相关
    DiDiGrabServerError(10100, "失败"),
    DiDiGrabSingleError(13001, "抢单失败"),
    DiDiHaveEntertained(13003, "订单已被其他平台抢单"),
    DiDiSingleTimeoutError(13004, "订单播单已超时，抢单失败"),
    openInvoiceError(19001, "开发票失败"),
    queryInvoiceError(19002, "发票查询失败"),
    resendInvoiceError(19003, "重发发票失败"),
    cancelInvoiceError(19004, "发票作废失败"),
    driverStatusSynFailed(1905, "司机状态同步失败"),
    getWorksheetFailed(10004, "查询工单失败"),
    createWorksheetFailed(14001, "创建工单失败"),
    updateWorksheetFailed(14002, "更新工单失败"),

    ugWorksheetFailed(14003, "工单加急失败"),
    misServerError(14004, "mis服务无法访问"),
    inspectionAmount(14005, "请检验输入金额!"),
    bingPhoneFailed(14005, "获取绑定手机号失败!"),
    unbindPhoneFailed(14006, "解绑手机号失败!"),
    notQueryOrderInfo(14007, "未查询到订单信息");


    int value;
    String desc;

    EDiDiErrorCode(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String toString() {
        return name();
    }

    @Override
    public String toChString() {
        return desc;
    }

    public String toMessage() {
        String errorMessage = this.value + "," + this.desc;
        return errorMessage;
    }
}
